Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable cop for pending rubocop-performance #102

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Enable cop for pending rubocop-performance #102

merged 1 commit into from
Feb 15, 2024

Conversation

ydah
Copy link
Member

@ydah ydah commented Feb 15, 2024

❯ bundle exec rubocop
Inspecting 42 files
.......................................C..

Offenses:

spec/spec_helper.rb:17:9: C: Performance/MethodObjectAsBlock: Use block explicitly instead of block-passing a method object.
  .each(&method(:require))
        ^^^^^^^^^^^^^^^^^

42 files inspected, 1 offense detected

Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • [-] Added tests.
  • [-] Updated documentation.
  • [-] Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

@ydah ydah requested a review from a team as a code owner February 15, 2024 10:16
@koic
Copy link
Member

koic commented Feb 15, 2024

JFYI, Setting NewCops: enable is a simple way to always enable newly added pending cops:
https://docs.rubocop.org/rubocop/1.60/versioning.html#enablingdisabling-pending-cops-in-bulk

@ydah
Copy link
Member Author

ydah commented Feb 15, 2024

JFYI, Setting NewCops: enable is a simple way to always enable newly added pending cops: https://docs.rubocop.org/rubocop/1.60/versioning.html#enablingdisabling-pending-cops-in-bulk

We are aware of that setting. But apparently we stopped enabling in the past when rubocop's cop shot us in the foot. But that was in 2020. Even if you changed to NewCops: enable these days, it might still be stable. @rubocop/rubocop-rspec What do you think?

```
❯ bundle exec rubocop
Inspecting 42 files
.......................................C..

Offenses:

spec/spec_helper.rb:17:9: C: Performance/MethodObjectAsBlock: Use block explicitly instead of block-passing a method object.
  .each(&method(:require))
        ^^^^^^^^^^^^^^^^^

42 files inspected, 1 offense detected
```
@pirj pirj merged commit fe2b31d into master Feb 15, 2024
24 checks passed
@pirj pirj deleted the perform branch February 15, 2024 13:39
@pirj
Copy link
Member

pirj commented Feb 15, 2024

Thank you!

As for always being on the edge we found it problematic, as new PRs could be constatnly blocked by new cops. This was delaying them indefinitely.

Also, we had to ‘bundle update’ locally, and now we just happily live with an old version of RuboCop in Gemfile.lock.
With the “edge RuboCop RSpec” GH job we can avoid worries, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants